{include file="public/toper"/}
<style>
    .layui-form-select {width: 150px;}
</style>
<div class="x-body">
    <form action="" method="post" class="layui-form" id="forms">
        <input type="hidden" value="{$list['admin_user_id']}" name="admin_user_id" class="layui-input">
        <div class="layui-form-item">
            <label for="username" class="layui-form-label">
                <span class="x-red">*</span>账号
            </label>
            <div class="layui-input-inline">
                <input type="text" value="{$list['name']}" id="username" name="name" required="" lay-verify="nikename" autocomplete="off"  class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="phone" class="layui-form-label">
                <span class="x-red">*</span>手机
            </label>
            <div class="layui-input-inline">
                <input type="text" id="phone" name="phone" required="" lay-verify="phone" value="{$list['phone']}" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="L_email" class="layui-form-label">
                <span class="x-red">*</span>邮箱
            </label>
            <div class="layui-input-inline">
                <input type="text" id="L_email" name="email" required="" lay-verify="email" value="{$list['email']}" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>
            </div>
        </div>
        {if condition = "$list.admin_user_id neq 1"}
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="x-red">*</span>角色</label>
            <div class="layui-input-block">
                <select name="admin_role_id" lay-verify="">
                    {volist name="role" id="vo"}
                    <option value="{$vo.admin_role_id}" {if condition="($vo.admin_role_id == $list.admin_role_id) "} selected = "selected"{/if} >{$vo['role_name']}</option>
                    {/volist}
                </select>
            </div>
        </div>
        {/if}
        <div class="layui-form-item">
            <label for="L_pass" class="layui-form-label">
                <span class="x-red">*</span>密码
            </label>
            <div class="layui-input-inline">
                <input type="password" id="L_pass" name="pass" required="" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">6到16个字符，不改则不填</div>
        </div>
        <div class="layui-form-item">
            <label for="L_repass" class="layui-form-label">
                <span class="x-red">*</span>确认密码
            </label>
            <div class="layui-input-inline">
                <input type="password" id="L_repass" name="repass" required="" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="L_repass" class="layui-form-label">
            </label>
            <button  class="layui-btn" lay-filter="formSubmit" lay-submit="">提交</button>
        </div>
        </form>
</div>
<script>
    layui.use('form', function() {
        $ = layui.jquery;
        var form = layui.form;

        //自定义验证规则
        form.verify({
            nikename: function(value){
                if(value.length < 5){
                    return '昵称至少得5个字符啊';
                }
            }
        });
    });
</script>
{include file="public/footer"/}